import type { App } from "vue";

import IconSvg from "@/components/IconSvg/index.vue";

import Icon from "@/components/Icon/index.vue";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";

// 全局注册Elementplus Icon
export function setOverAllComponents(app: App<Element>) {
	// 纯SVG 图片
	app.component("IconSvg", IconSvg);

	// IconFont 和 Element-plus 图片兼容
	app.component("Icon", Icon);

	// Element-plus 图片兼容
	for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
		app.component(key, component);
	}
}
